package com.Jin.service;

import com.Jin.mapper.EmployeeMapper;
import com.Jin.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


@Component
public class EmployeeSerivceImpl implements EmployeeService{

    @Autowired
    private EmployeeMapper employeeMapper;

    public EmployeeSerivceImpl(EmployeeMapper employeeMapper) {
        this.employeeMapper = employeeMapper;
    }

    @Override
    public List<Employee> queryEmployee() {
        return employeeMapper.queryEmployee();
    }

    @Override
    public Employee queryById(@RequestParam("Eid") int Eid) {
        return employeeMapper.queryById(Eid);
    }

    @Override
    public Employee queryByUrl(@PathVariable("id") int id) {
        return employeeMapper.queryByUrl(id);
    }
}
